<template>
    <div class="tmpl newsInfo">
        <h3>咨询详情</h3>
        <div class="title">
		   <h4 v-text="info.title"></h4>
		   <p>{{ info.add_time | datefmt('YYYY-MM-DD') }}  {{info.click}}次浏览</p>
	   </div>
		<div id="content" v-html="info.content" ></div>
        <comment :artid = "id"></comment>
    </div>
</template>

<script>
    import common from "../../../statics/js/common.js";
    import comment from "../subcom/comment.vue";
    export default{
        components:{
            comment
        },
        data(){
            return{
                id:this.$route.params.id,
                info:{}
            }
        },
        created(){
            this.getInfo()
        },
        methods:{
            getInfo(){
                this.$http.get(common.domain+"/api/getnew/"+this.id).then((re) =>{
                    if(re.body.status !=0){
                        Toast(re.body.mesaage);
                        return;
                    }
                    this.info = re.body.message[0];
                });
            }
        }
    }
</script>

<style lang="scss" scoped>
    .newsInfo{
        h3{
            text-align: center;
            margin:10px auto;
            color:aqua;
            font-size:16px;
            font-weight: normal
        }
        #content{
            padding:5px;
        }
    }
</style>
